﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Ay.MvcFramework;
using Ay.MvcFramework.AyMarkupExtension;
using MPSystem.Controllers;
using Ay.Framework.WPF.Controls;
using Ay.Framework.DataCreaters;
using Ay.Framework.DataCreaters.AY;
using MPSystem.Controllers;

namespace MPSystem.Views.BasicDataSet_System
{
    /// <summary>
    /// AyDataViewDemo0View.xaml 
    /// 创建时间：2017/11/27 15:42:45
    /// </summary>
    public partial class BasicDataSet_SystemView : AyPage
    {
        public BasicDataSet_SystemView()
        {
            InitializeComponent();
            AYUI.Message.Register<object>(this, MESSAGES.IsDBLC, DBLC);

            AYUI.Message.Register<object>(this, MESSAGES.IsDBXC, DBXC);
        }

   
        /// <summary>
        /// 
        /// </summary>%
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void DBXC(object obj)
        {
            Adb.Width = 0;
            Bdb.Width = 0;
        }
        private void DBLC(object obj)
        {
            Adb.Width = 80;
            Bdb.Width = 80;
        }
        /// <summary>
        /// 设置
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_SZ_Click(object sender, RoutedEventArgs e)
        {
            ShowNavigationWindow("串口配置", "/Views/BasicDataSet/BasicDataSet_COM.xaml", 600, 500);
        }

        private void btn_com_Click(object sender, RoutedEventArgs e)
        {
            ShowNavigationWindow("串口配置", "/Views/BasicDataSet/BasicDataSet_COM.xaml", 600, 500);
        }

        /// <summary>/// 弹出层对象/// </summary>

        public static NavigationWindow window = null;
        /// <summary>/// 使用NavigationWindow弹出页面/// </summary>

        private void ShowNavigationWindow(string title, string uri, int width, int height)
        {
            window = new NavigationWindow();
            window.Title = title;
            window.Width = width;
            window.Height = height;
            window.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            window.ResizeMode = ResizeMode.NoResize;
            window.Source = new Uri(uri, UriKind.Relative);
            window.ShowsNavigationUI = false;
        
            window.ShowDialog();
        }
    }












































    public partial class BasicDataSet_SystemView : AyPage
    {
        #region 控制器
        private Actions<BasicDataSet_SystemController> _mvc;
        public Actions<BasicDataSet_SystemController> Mvc
        {
            get
            {
                if (_mvc == null)
                {
                    _mvc = new Actions<BasicDataSet_SystemController>(DataContext as BasicDataSet_SystemController);
                }
                return _mvc;
            }
        }
        #endregion
    }


}
